/**
    ******************************************************************************
    * @file    rbTree.h
    * @author  debian
    * @version V1.0.0
    * @date    2019-12-31
    * @brief   红黑树
    ******************************************************************************
    * @attention
    *
    *
    ******************************************************************************
    */ 

/* Define to prevent recursive inclusion -------------------------------------*/
#ifndef __RBTREE_H
#define __RBTREE_H

#ifdef __cplusplus
    extern "C" {
#endif

/* Includes ------------------------------------------------------------------*/


/** @addtogroup DataStruct_Driver
    * @{
    */

/** @addtogroup rbTree
    * @{
    */
typedef int Elemtype;
typedef enum
{
	RED = 0,
	BLACK,
}_color;

		
#define RBTREE_ENTRY(name, type)	\
	struct name 					\
	{								\
		struct type *left;			\
		struct type *right; 		\
		struct type *parent;		\
		_color color;				\
	}
		
	typedef struct rbTree_node
	{
		Elemtype data;								//结点数据
		RBTREE_ENTRY(, rbTree_node) rbst;			//红黑树结点信息
	}_rbTree_node;
	
	
	typedef struct rbTree
	{
		struct rbTree_node *root;					//指向根结点
		struct rbTree_node *nil;					//nil结点
	}_rbTree;


/* Exported types ------------------------------------------------------------*/
/** @defgroup 
    * @{
    */ 



/**
    * @}
    */


/* Exported constants --------------------------------------------------------*/

/* Exported macro ------------------------------------------------------------*/

/* Exported functions --------------------------------------------------------*/ 
/* Initialization and de-initialization functions *******************************/
/** @addtogroup rbTree_Exported_Functions
    * @{
    */

/** @addtogroup rbTree_Exported_Functions_Group1
    * @{
    */


/**
    * @}
    */

/* operation functions *******************************************************/
/** @addtogroup rbTree_Exported_Functions_Group2
    * @{
    */



/**
    * @}
    */

/**
    * @}
    */ 

/**
    * @}
    */

/**
    * @}
    */


#ifdef __cplusplus
}
#endif

#endif /* __RBTREE_H */

/******************* (C) 2019 HOME 深圳龙华 *****END OF FILE****/

